home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Delphi Magazine Collection 2001
/
Delphi Magazine Collection 20001 (2001).iso
/
DISKS
/
Issue70
/
system
/
Listing2.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-05-02
|
523b
|
18 lines
var
libuuidHandle: Pointer;
uuid_generate_time: procedure (out Guid: TGUID) cdecl;
function CreateGUID (out Guid: TGUID): HResult;
const
E_NOTIMPL = HRESULT($80004001);
begin
Result := E_NOTIMPL;
if libuuidHandle = nil then begin
libuuidHandle := dlopen ('libuuid.so.1', RTLD_LAZY);
if libuuidHandle = nil then Exit;
uuid_generate_time := dlsym (libuuidHandle, 'uuid_generate_time');
if @uuid_generate_time = nil then Exit;
end;
uuid_generate_time (Guid);
Result := 0;
end;